package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginVo;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: badaotianqiong
 * @Date: 2025/6/19 18:58
 * @Description:
 **/
@RestController
@RequestMapping("/user/index")
public class UserController {
    @Autowired
    private TbUserService tbUserService;

    @PostMapping("/login")
    public R login(@RequestBody @Validated LoginVo loginVo){
        return tbUserService.login(loginVo);
    }

    @PostMapping("/getMenuByUserId")
    public R getMenuByUserId(){
        return tbUserService.getMenuByUserId();
    }

    @PostMapping("/getUserList")
    public R getUserList(@RequestBody PageInfoVo pageInfoVo){
        return tbUserService.getUserList(pageInfoVo);
    }
}
